﻿namespace BaseAPI.BaseViewModel;

public class PageResponse
{
    public void SetPage(int pageSize, int rowCount)
    {
        DataCount = rowCount;
        var addPage = rowCount % pageSize == 0 ? 0 : 1;
        PageCount = rowCount / pageSize + addPage;
    }
    /// <summary>
    /// 数据总共多少条
    /// </summary>
    public int DataCount { get; private set; }
    /// <summary>
    /// 总页数
    /// </summary>
    public int PageCount { get; private set; }
}